﻿using Longbow.OAuth;
using Microsoft.AspNetCore.Authentication.OAuth.Claims;
using System.Security.Claims;

namespace Longbow.WeChatAuth
{
    /// <summary>
    /// Gitee 认证配置实体类
    /// </summary>
    public class WeChatOptions : LgbOAuthOptions
    {
        /// <summary>
        /// 构造函数
        /// </summary>
        public WeChatOptions() : base()
        {
            AuthorizationEndpoint = WeChatDefaults.AuthorizationEndpoint;
            TokenEndpoint = WeChatDefaults.TokenEndpoint;
            UserInformationEndpoint = WeChatDefaults.UserInformationEndpoint;
            HomePath = WeChatDefaults.HomePath;

            // 设置登陆信息
            ClaimActions.Remove(ClaimTypes.Name);
            ClaimActions.Add(new JsonKeyClaimAction(ClaimTypes.Name, ClaimValueTypes.String, "unionid"));
        }
    }
}
